package com.xishu.bo;

import com.xishu.entity.shop.Item;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Objects;

public class Stock implements Serializable {
    private static final long serialVersionUID = 61007277874658288L;

    @ApiModelProperty(value = "菜品ID")
    private Long itemId;

    @ApiModelProperty(value = "菜品余量")
    private Integer leftCount;

    @ApiModelProperty(value = "锁定量")
    private Integer lockCount;

    @ApiModelProperty(value = "要减少的数量")
    private Integer cutItemCount;

    @ApiModelProperty(value = "余量不够")
    private Boolean error;

    @ApiModelProperty(value = "扫描")
    private Boolean scanOrder;

    @ApiModelProperty(value = "菜品")
    private Item item;

    @ApiModelProperty(value = "已售罄")
    private Boolean saleOut;

    @ApiModelProperty(value = "可用的数量")
    private int availableCount;

    public Boolean getScanOrder() {
        return scanOrder;
    }

    public void setScanOrder(Boolean scanOrder) {
        this.scanOrder = scanOrder;
    }

    public Boolean getError() {
        return error;
    }

    public void setError(Boolean error) {
        this.error = error;
    }

    public Item getItem() {
        return item;
    }

    public void setItem(Item item) {
        this.item = item;
    }

    public Boolean getSaleOut() {
        return saleOut;
    }

    public void setSaleOut(Boolean saleOut) {
        this.saleOut = saleOut;
    }

    public int getAvailableCount() {
        return availableCount;
    }

    public void setAvailableCount(int availableCount) {
        this.availableCount = availableCount;
    }

    public Long getItemId() {
        return itemId;
    }

    public void setItemId(Long itemId) {
        this.itemId = itemId;
    }

    public Integer getLeftCount() {
        return leftCount;
    }

    public void setLeftCount(Integer leftCount) {
        this.leftCount = leftCount;
    }

    public Integer getLockCount() {
        return lockCount;
    }

    public void setLockCount(Integer lockCount) {
        this.lockCount = lockCount;
    }

    public Integer getCutItemCount() {
        return cutItemCount;
    }

    public void setCutItemCount(Integer cutItemCount) {
        this.cutItemCount = cutItemCount;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Stock stock = (Stock) o;
        return Objects.equals(itemId, stock.itemId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(itemId);
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("Stock{");
        sb.append("itemId=").append(itemId);
        sb.append(", leftCount=").append(leftCount);
        sb.append(", lockCount=").append(lockCount);
        sb.append(", cutItemCount=").append(cutItemCount);
        sb.append(", error=").append(error);
        sb.append(", scanOrder=").append(scanOrder);
        sb.append(", item=").append(item);
        sb.append(", saleOut=").append(saleOut);
        sb.append(", availableCount=").append(availableCount);
        sb.append('}');
        return sb.toString();
    }
}
